package com.itheima.web.manager;/*
 * @author  xs
 * @date 2022/1/15 10:23
 * @Version  1.0
 * */

import cn.hutool.core.collection.CollectionUtil;
import com.itheima.domain.db.UserInfo;
import com.itheima.domain.vo.PageBeanVo;
import com.itheima.domain.vo.UserInfoVo;
import com.itheima.service.db.BackGroupService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class BackGroupManager {
@DubboReference
private BackGroupService backGroupService;
//查询用户
    public ResponseEntity findAllUser(Integer pageNum, Integer pageSize) {

        PageBeanVo allUser = backGroupService.findAllUser(pageNum, pageSize);
//          获得list
        List<UserInfo> userInfoList = (List<UserInfo>) allUser.getItems();
        ArrayList<UserInfoVo> userInfoVos = new ArrayList<>();
        if (CollectionUtil.isNotEmpty(userInfoList)){
            for (UserInfo userInfo : userInfoList) {


                }
        }
        System.out.println("所有用户：："+allUser);

          return  ResponseEntity.ok(allUser);

    }
}
